
package com.lry.compressor;

import com.lry.spi.EnhancedServiceLoader;


public class CompressorFactory {

    /**
     * Get compressor by code.
     *
     * @param code the code
     * @return the compressor
     */
    public static Compressor getCompressor(byte code) {
        CompressorType type = CompressorType.getByCode(code);
        return EnhancedServiceLoader.load(Compressor.class, type.getValue());
    }


}
